package com.jxw.launcher.transformer;

import android.support.v4.view.ViewPager;
import android.view.View;

/* loaded from: classes.dex */
public class ZoomOutPageTransformer implements ViewPager.PageTransformer {
    private static final float MIN_ALPHA = 0.5f;
    private static final float MIN_SCALE = 0.6f;

    @Override // android.support.v4.view.ViewPager.PageTransformer
    public void transformPage(View view, float f) {
        int width = view.getWidth();
        int height = view.getHeight();
        if (f < -1.0f) {
            view.setAlpha(0.5f);
            view.setScaleX(MIN_SCALE);
            view.setScaleY(MIN_SCALE);
        } else if (f <= 1.0f) {
            float max = Math.max((float) MIN_SCALE, 1.0f - Math.abs(f));
            float f2 = 1.0f - max;
            float f3 = (height * f2) / 2.0f;
            float f4 = (width * f2) / 2.0f;
            if (f < 0.0f) {
                view.setTranslationX(f4 - (f3 / 2.0f));
                float f5 = (f * 0.3f) + 1.0f;
                view.setScaleX(f5);
                view.setScaleY(f5);
            } else {
                view.setTranslationX((-f4) + (f3 / 2.0f));
                float f6 = 1.0f - (f * 0.3f);
                view.setScaleX(f6);
                view.setScaleY(f6);
            }
            view.setAlpha((((max - MIN_SCALE) / 0.39999998f) * 0.5f) + 0.5f);
        } else {
            view.setScaleX(MIN_SCALE);
            view.setScaleY(MIN_SCALE);
            view.setAlpha(0.5f);
        }
    }
}
